
function switchOffWarnings
% 
% switch off nasty warnings from optmizations
warningMessagesToSwitchOff = {...
    'MATLAB:eigs:SigmaNearExactEig',...
    'MATLAB:nearlySingularMatrix',...
    'MATLAB:mir_warning_maybe_uninitialized_temporary',...
    'MATLAB:singularMatrix',...
    'MATLAB:illConditionedMatrix',...
    'MATLAB:rankDeficientMatrix'};          
for iWarn =1:numel(warningMessagesToSwitchOff)
    warning('off', warningMessagesToSwitchOff{iWarn});
end

%warning('off');